<?php
/**
 * 分类模型
 */
class Category extends CI_Model {
    
    public function __construct() {
        parent::__construct();
    }
    
    /**
     * 获取分类
     * @param $condition array
     * @param $row 取单条记录
     */
    public function getCategory($condition, $offset, $pagesize, $row = TRUE) {
        
       $res = $this->db->get_where('category',$condition,$pagesize,$offset);
       
       if($row) {
           return $res->row_array();
       }
       
       return $res->result_array();
    }
}